package com.ruoyi.web.controller.system;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.Student3;
import com.ruoyi.system.service.IStudent3Service;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 学生表3Controller
 * 
 * @author ruoyi
 * @date 2025-02-13
 */
@RestController
@RequestMapping("/system/student3")
public class Student3Controller extends BaseController
{
    @Autowired
    private IStudent3Service student3Service;

    /**
     * 查询学生表3列表
     */
    @PreAuthorize("@ss.hasPermi('system:student3:list')")
    @GetMapping("/list")
    public TableDataInfo list(Student3 student3)
    {
        startPage();
        List<Student3> list = student3Service.selectStudent3List(student3);
        return getDataTable(list);
    }

    /**
     * 导出学生表3列表
     */
    @PreAuthorize("@ss.hasPermi('system:student3:export')")
    @Log(title = "学生表3", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, Student3 student3)
    {
        List<Student3> list = student3Service.selectStudent3List(student3);
        ExcelUtil<Student3> util = new ExcelUtil<Student3>(Student3.class);
        util.exportExcel(response, list, "学生表3数据");
    }

    /**
     * 获取学生表3详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:student3:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(student3Service.selectStudent3ById(id));
    }

    /**
     * 新增学生表3
     */
    @PreAuthorize("@ss.hasPermi('system:student3:add')")
    @Log(title = "学生表3", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody Student3 student3)
    {
        return toAjax(student3Service.insertStudent3(student3));
    }

    /**
     * 修改学生表3
     */
    @PreAuthorize("@ss.hasPermi('system:student3:edit')")
    @Log(title = "学生表3", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody Student3 student3)
    {
        return toAjax(student3Service.updateStudent3(student3));
    }

    /**
     * 删除学生表3
     */
    @PreAuthorize("@ss.hasPermi('system:student3:remove')")
    @Log(title = "学生表3", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(student3Service.deleteStudent3ByIds(ids));
    }
}
